package com.n9.qqonline.api;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;

/**
 * 返回的数据模型
 *
 * @author ice
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RespModel<T> implements Serializable {
    /**
     * 返回正常代码：200
     */
    public static final int NORMAL_CODE = 200;

    /**
     * service抛出的错误代码
     */
    public static final int ERROR_CODE_DEFAULT = 221;
    /**
     * 登陆过期
     */
    public static final int ERROR_CODE_LOGIN_EXPIRES = 211;
    /**
     * 已登陆,无权限
     */
    public static final int ERROR_CODE_NO_PERMISSION = 212;

    /**
     * 返回代码
     */
    private Integer code;
    /**
     * 返回数据
     */
    private T data;
    /**
     * 返回错误消息
     */
    private String msg;

    private RespModel() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
